 <?php
//Box
class test_Reload extends Bout {

  protected $text = 'Nombre de click';
  protected $count = 0;
  protected $url = 'test/reload.php';
  protected $objetCible = null;

  public function setText($arg) {
    $this->text = $arg;
  }

  public function setCount($arg) {
    $this->count = $arg;
  }

  public function setObjetCible($oC) {
    $this->objetCible = $oC;
  }

  public function onEvent() {
    $this->count++;
    if($this->count > 20)
      $this->count = 0;
  }

  function build() {

    $this->addArgument('count');
    $this->addArgument('objetCible');

  if($this->objetCible ==null)
    $this->objetCible = $this->name;

    return $this->writeArgument().'<input id="'.$this->name.'_increment" type="button" '.' value="Nombre de click ('.$this->count.')" onClick="'.$this->event('reLoad',$this->objetCible).'"/>';
//.$this->addListener('onClick','reLoad','incrementCount',$this->name.'_increment')
//.$this->event('onMouseOver','incrementCount').'value="'.$this->text

  }
}
?>